//
//  ViewController.m
//  11-9IOS
//
//  Created by blue on 15-11-9.
//  Copyright (c) 2015年 lcm. All rights reserved.
//

#import "ViewController.h"
#import "TestViewController.h"
@interface ViewController ()
{
    UILabel * l;
    



}
@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    
    
    self.title =@"我的标题栏";
    
    self.view.backgroundColor = [UIColor magentaColor];
    l = [UILabel new];
    l.text =@"你好，世界！";
    [l sizeToFit];
    l.center = CGPointMake (self.view.frame.size.width/2.0,self.view.frame.size.height/2.0);
    l.textColor = [UIColor darkGrayColor];
    [self.view addSubview:l];
    
    
    UIButton * btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    btn.frame = CGRectMake(100, 100, 200, 44);
    [btn setTitle:@"按钮" forState:UIControlStateNormal];
    [btn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(onClick:) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:btn];
}

-(void)onClick: (id)sender{
    
    
    TestViewController * con = [TestViewController new];
    [self.navigationController pushViewController:con animated:YES];

}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
